package com.nbsaas.boot.product.rest.resource;

import com.nbsaas.boot.product.api.apis.ProductSpecificationValueApi;
import com.nbsaas.boot.product.data.entity.ProductSpecificationValue;
import com.nbsaas.boot.product.api.domain.request.ProductSpecificationValueRequest;
import com.nbsaas.boot.product.api.domain.response.ProductSpecificationValueResponse;
import com.nbsaas.boot.product.api.domain.simple.ProductSpecificationValueSimple;
import com.nbsaas.boot.product.rest.convert.ProductSpecificationValueSimpleConvert;
import com.nbsaas.boot.product.rest.convert.ProductSpecificationValueEntityConvert;
import com.nbsaas.boot.product.rest.convert.ProductSpecificationValueResponseConvert;
import com.nbsaas.boot.product.data.repository.ProductSpecificationValueRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   商品规格值-业务接口实现
*/
@Transactional
@Service
public class ProductSpecificationValueResource extends BaseResource<ProductSpecificationValue,ProductSpecificationValueResponse, ProductSpecificationValueSimple, ProductSpecificationValueRequest>  implements ProductSpecificationValueApi {

    @Resource
    private ProductSpecificationValueRepository productSpecificationValueRepository;

    @Override
    public JpaRepositoryImplementation<ProductSpecificationValue, Serializable> getJpaRepository() {
        return productSpecificationValueRepository;
    }

    @Override
    public Function<ProductSpecificationValue, ProductSpecificationValueSimple> getConvertSimple() {
        return new ProductSpecificationValueSimpleConvert();
    }

    @Override
    public Function<ProductSpecificationValueRequest, ProductSpecificationValue> getConvertForm() {
        return new ProductSpecificationValueEntityConvert();
    }

    @Override
    public Function<ProductSpecificationValue, ProductSpecificationValueResponse> getConvertResponse() {
        return new ProductSpecificationValueResponseConvert();
    }




}


